package com.cskaoyan.com.collection.linkedhashmap;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class DemoLinkedHashMap3 {
    public static void main(String[] args) {

//        LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder)
//        构造一个带指定初始容量、加载因子和排序模式的空 LinkedHashMap 实例。


        LinkedHashMap<String, Integer> map =
                new LinkedHashMap<>();
        map.put("zs", 18);
        map.put("ls", 19);
        map.put("wu", 20);
        map.put("zl", 21);

//        Set<String> strings = map.keySet();
//        System.out.println(strings);

        Set<Map.Entry<String, Integer>> entries = map.entrySet();
        for (Map.Entry<String, Integer> entry : entries) {
            System.out.println(entry);
        }

    }
}
